package com.ruyuan.payment.pay.controller.admin;

import com.ruyuan.payment.server.resp.CommonResp;
import com.ruyuan.payment.server.resp.OrderSnapshotQueryResp;
import com.ruyuan.payment.server.service.OrderSnapshotService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/admin/order-snapshot")
public class AdminOrderSnapshotController {

    @Resource
    private OrderSnapshotService orderSnapshotService;

    @GetMapping("/query-one/{orderNo}")
    public CommonResp queryList(@PathVariable String orderNo) {
        CommonResp<OrderSnapshotQueryResp> commonResp = new CommonResp<>();
        OrderSnapshotQueryResp queryResp = orderSnapshotService.queryOne(orderNo, null);
        commonResp.setContent(queryResp);
        return commonResp;
    }
}
